C51 COMPILER V7.06   MAIN                                                                  10/31/2008 13:27:10 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\OUT\main.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND PRINT(.\LST\main.lst) OBJECT(.\OUT\main.ob
                    -j)

stmt level    source

   1          #include "sm59d04g2sfr.h"
   2          #include "DEFINE.h"
   3          
   4          extern void GoToIsp_59D();
   5          extern void isp_program_byte(uint add, uchar dat);
   6          extern void isp_erase_sector(uchar  num);
   7          extern uchar isp_read_byte(uint add);
   8          void delay2(uint x);
   9          
  10          uchar idata read_buf[58];
  11          
  12          uchar  idata data_buf[58] = {
  13                  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
  14                  0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  15                  0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,
  16                  0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
  17                  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39
  18          };
  19          
  20          void read(void);
  21          void write(void);
  22          
  23          void main()
  24          {
  25   1              uchar m;
  26   1              AUXR |= 0x01;           //disable ale
  27   1              if (P00 == 0)
  28   1              {
  29   2              GoToIsp_59D();
  30   2              }
  31   1              isp_erase_sector(0);
  32   1              write();
  33   1              read();
  34   1      
  35   1      /*check EEPROM successful*/
  36   1      while(1)
  37   1      {       
  38   2              for (m = 0; m < 58; m++)
  39   2              {
  40   3              if(read_buf[m] !=data_buf[m])   //check fail
  41   3                      {
  42   4                      delay2(2000);   
  43   4                      P1 = 0xAA;                      
  44   4                      P3 = m;                                                 //show fail address
  45   4                      P2 = read_buf[m];                               //show read data
  46   4                      P0 = data_buf[m];                               //show correct data
  47   4                      }
  48   3                      
  49   3                      else{
  50   4                      delay2(100);
  51   4                      P1 = 0x55;}
  52   3      
  53   3              }
  54   2      }
C51 COMPILER V7.06   MAIN                                                                  10/31/2008 13:27:10 PAGE 2   

  55   1      }
  56          
  57          void read(void)
  58          {
  59   1              uchar m;
  60   1              for (m = 0; m < 58; m++) {
  61   2      
  62   2              read_buf[m] =isp_read_byte(m);  //SyncMOS
  63   2              }
  64   1      
  65   1      }
  66          void write(void)
  67          {
  68   1              uchar m;
  69   1              for (m = 0; m < 58; m++) {
  70   2      
  71   2                      isp_program_byte(m, data_buf[m]);       //SyncMOS
  72   2      
  73   2              }
  74   1      
  75   1      }
  76          void delay2(uint x)   //1ms
  77          {
  78   1              uchar y;
  79   1              while (x--) {
  80   2                      y = 110;
  81   2                      while (y--) {
  82   3                              ;}
  83   2              }
  84   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    164    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       3
   IDATA SIZE       =    116    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
